export class BaseService {
  static metadata = {
    name: 'base',
    dependencies: [],
    singleton: true
  }
  
  constructor() {
    // app 实例将在 bootstrap 时注入
    this.app = null
  }
  
  // 便捷访问器 - 直接访问 app 的核心服务
  get config() {
    return this.app?.config
  }
  
  get logger() {
    return this.app?.logger
  }
  
  get db() {
    return this.app?.db
  }
  
  get eventBus() {
    return this.app?.eventBus
  }
  
  get scheduler() {
    return this.app?.scheduler
  }
  
  get wsManager() {
    return this.app?.wsManager  // WebSocket 管理器
  }
  
  get hono() {
    return this.app?.app  // Hono 实例
  }
  
  async onInit() {}
  async onStart() {}
  async onStop() {}
  
  registerRoutes(app) {
    return null
  }
  
  registerWebSocketHandlers(wsManager) {
    return null
  }
  
  registerEventListeners(eventBus) {
    return null
  }
  
  registerScheduledTasks(scheduler) {
    return null
  }
}